/**
 * 
 */
package com.vision.core.cm.util;

import java.util.Date;

import com.google.gwt.i18n.shared.DateTimeFormat;

/**
 * Client-side implementation for {@link IDateFormat}. Uses {@link DateTimeFormat}.
 * 
 * @author Mark
 *
 */
public class GwtDateFormat implements IDateFormat {

	@Override
	public String format(Date date, String format) {
		return DateTimeFormat.getFormat(format).format(date);
	}
	
	@Override
	public Date parse(String dateAsString, String format) {
		return DateTimeFormat.getFormat(format).parse(dateAsString);
	}

}
